home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_7205.txt < prev    next >
Text File  |  1991-02-27  |  1KB  |  32 lines

  1. -- card: 7205 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 7
  9. ----- text -----
  10. 13
  11.  
  12. -- part contents for background part 6
  13. ----- text -----
  14. 1.  Introduction
  15.  
  16. -- part contents for background part 4
  17. ----- text -----
  18. Think C 4.0 (TC) is an extension of the C programming language to support object-oriented programming (OOP).  C++ carries this extension further, at the expense of simplicity.  This chapter provides sample TC programs which emphasize the OOP approach.  We will first define a few OOP terms and their use in TC.
  19.  
  20. An OBJECT is a data structure combined - or ENCAPSULATED - with the procedures which will act upon this data.  The organization of this object is the object's CLASS, or the type of the object.  That is, a class definition lists the INSTANCE VARIABLES (data) which are contained in all objects of this type, as well as the METHODS (procedures), acting upon the data.  In TC, the definition for the 'Person' class may look like:
  21.  
  22.     struct Person:indirect
  23.     {
  24.         int age;
  25.         int weight;
  26.         set();
  27.         print();
  28.     };
  29.  
  30. -- part contents for background part 17
  31. ----- text -----
  32. p17